Skip to content

Add entity row that displays static text#5516

Merged
bramkragten merged 2 commits intodevfrom
row-static-text
Apr 15, 2020
Merged

Add entity row that displays static text#5516
bramkragten merged 2 commits intodevfrom
row-static-text

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Apr 10, 2020

Breaking change

Proposed change

Add a new entity row to display static text.

Fixes home-assistant/core#33846

type: entities
title: My Title
entities:
  - type: text
    name: Hello
    text: World
    icon: mdi:party-popper

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@balloob balloob changed the title Add entity row that displays text Add entity row that displays static text Apr 10, 2020
@zsarnett
Copy link
Copy Markdown
Contributor

I think text should be optional

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Apr 10, 2020

It's… a text row? why would it be optional ?

Comment thread src/panels/lovelace/special-rows/hui-text-row.ts Outdated
Comment thread src/panels/lovelace/special-rows/hui-text-row.ts Outdated
cast: () => import("../special-rows/hui-cast-row"),
buttons: () => import("../special-rows/hui-buttons-row"),
attribute: () => import("../special-rows/hui-attribute-row"),
text: () => import("../special-rows/hui-text-row"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to Lazy load?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazy load is the default. Only ones that are super popular should be considered to be bundled. Requires an editor too.

return html``;
}

return html`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just use the generic row here to keep it the same as the others? Lest maintenance if it changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic row relies on an entity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah didnt realize

@zsarnett
Copy link
Copy Markdown
Contributor

What if I wanted to just have text in the first column. As a title to the card or something. I see more use with not having the left value than having it. But just my POV

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Apr 10, 2020

This row shouldn't be used for that. We have sections etc for that. If we allow that, people will want to add features to this row that will just blow up the scope. Let's keep it like this for now. You can always put a space for text ;)

@iantrich
Copy link
Copy Markdown
Member

What if I wanted to just have text in the first column. As a title to the card or something. I see more use with not having the left value than having it. But just my POV

And if someone really wanted that they can just do text: ' '

@bramkragten bramkragten merged commit 4f81085 into dev Apr 15, 2020
@bramkragten bramkragten deleted the row-static-text branch April 15, 2020 13:59
@lock lock Bot locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please do not remove ups.model from Nut in future versions.

5 participants